package mx.utils.mapUtils;

import java.io.IOException;
import java.util.HashMap;

import org.apache.http.HttpResponse;
import org.apache.http.ParseException;
import org.apache.http.util.EntityUtils;

import mx.utils.weatherUtil.HttpUtils;

public class Map {
	public static String getMap() throws Exception {
		String host = "http://staticmap.market.alicloudapi.com";
		String path = "/v3/staticmap";
		String method = "GET";
		String appcode = "44b70529cb094b4a83d253989d1981df";
		HashMap<String, String> headers = new HashMap<String, String>();
		// 最后在header中的格式(中间是英文空格)为Authorization:APPCODE
		// 83359fd73fe94948385f570e3c139105
		headers.put("Authorization", "APPCODE " + appcode);
		HashMap<String, String> querys = new HashMap<String, String>();
		querys.put("labels", "朝阳公园,2,0,16,0xFFFFFF,0x008000:116.48482,39.94858");
		querys.put("location", "116.481485,39.990464");
		querys.put("markers", "mid,0xFF0000,A:116.481485,39.990464");
		querys.put("paths",
				"10,0x0000ff,1,,:116.31604,39.96491;116.320816,39.966606;116.321785,39.966827;116.32361,39.966957");
		querys.put("scale", "1");
		querys.put("size", "750*300");
		querys.put("traffic", "0");
		querys.put("zoom", "10");

		HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys);

		String a = EntityUtils.toString(response.getEntity());
		return a;

	}
}
